#!/bin/bash
# AIC Library Installation File
#
# Copyright (c) 2010 Peter Polacik <polacik.p@gmail.com>
# Licensed under MIT License

filename=$1
target_dir=$2

cp ${filename} ${target_dir}/${filename}
if [ $? -ne 0 ]; then
	echo "An Error occured, check messages for informations!" >&2
else
	if [ -e ${target_dir}/libaic.so.1 ]; then sleep 1
		else ln -s ${target_dir}/${filename} ${target_dir}/libaic.so.1
	fi
	if [ -e ${target_dir}/libaic.so ]; then sleep 1
		else ln -s ${target_dir}/${filename} ${target_dir}/libaic.so
	fi
	echo "Installation successful!"
fi
